package com.chaosj.tools.rules

import com.chaosj.tools.StockDiscoverTools

class DownRule implements IAbnormalRule{
    @Override
    boolean execute(String stockName, List<StockDiscoverTools.DescriptionStock> stocks) {
        int index = stocks.size()-1
        if( stocks.get(index-1).fallBack() && stocks.get(index).todayUp()>=0.98 ){
            println(description(stockName))
            return true
        }
        return false
    }

    @Override
    boolean support(String stockName, List<StockDiscoverTools.DescriptionStock> stocks) {
        return stocks.size()>=2
    }

    @Override
    String description(Object... desc) {
        return String.format("【%s】昨天最高到达9个点收盘下跌3个点以上，今天开盘竞价在-2个点以内.请注意是否起飞",desc)
    }
}
